function A = generA(nn,tau1,tau2)
%generate A
h = 1/(nn+1);
eta1 = tau1/2/(nn+1);
eta2 = tau2/2/(nn+1);
e = ones(nn,1);
C1 = spdiags([e+eta1*e,-2*e,e-eta1*e],-1:1,nn,nn);
C2 = spdiags([e+eta2*e,-2*e,e-eta2*e],-1:1,nn,nn);
B = spdiags([e,-2*e,e],-1:1,nn,nn);
A = (kron(speye(nn),kron(speye(nn),C1))+kron(kron(B,speye(nn))+kron(speye(nn),C2),speye(nn)))/h^2;
end
